﻿<phone:PhoneApplicationPage 
    x:Class="SheepClock.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="PortraitOrLandscape" Orientation="Portrait"
    shell:SystemTray.IsVisible="False"
    
    Loaded="PhoneApplicationPage_Loaded"
    Unloaded="PhoneApplicationPage_Unloaded"
    LayoutUpdated="PhoneApplicationPage_LayoutUpdated"
    OrientationChanged="PhoneApplicationPage_OrientationChanged">


    <phone:PhoneApplicationPage.Resources>
        <Storyboard x:Name="PushStoryboard1">
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="colorButton">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
        			<EasingDoubleKeyFrame.EasingFunction>
        				<CubicEase EasingMode="EaseOut"/>
        			</EasingDoubleKeyFrame.EasingFunction>
        		</EasingDoubleKeyFrame>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="colorButton">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
        			<EasingDoubleKeyFrame.EasingFunction>
        				<CubicEase EasingMode="EaseOut"/>
        			</EasingDoubleKeyFrame.EasingFunction>
        		</EasingDoubleKeyFrame>
        	</DoubleAnimationUsingKeyFrames>
        	<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="colorButton">
        		<EasingDoubleKeyFrame KeyTime="0" Value="0"/>
        		<EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="30">
        			<EasingDoubleKeyFrame.EasingFunction>
        				<CubicEase EasingMode="EaseOut"/>
        			</EasingDoubleKeyFrame.EasingFunction>
        		</EasingDoubleKeyFrame>
        	</DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryboard2">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="alarmsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="alarmsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="alarmsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="30">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PushStoryboard3">
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="settingsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="1">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="settingsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0.5"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="settingsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="0"/>
                <EasingDoubleKeyFrame KeyTime="0:0:0.3" Value="30">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <CubicEase EasingMode="EaseOut"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>

        <Storyboard x:Name="PopBackStoryBoard1">
            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="colorButton" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="colorButton" d:IsOptimized="True"/>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="colorButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="30"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ElasticEase EasingMode="EaseOut" Springiness="3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PopBackStoryBoard2">
            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="alarmsButton" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="alarmsButton" d:IsOptimized="True"/>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="alarmsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="30"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ElasticEase EasingMode="EaseOut" Springiness="3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
        <Storyboard x:Name="PopBackStoryBoard3">
            <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationX)" Storyboard.TargetName="settingsButton" d:IsOptimized="True"/>
            <DoubleAnimation Duration="0" To="0" Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.CenterOfRotationY)" Storyboard.TargetName="settingsButton" d:IsOptimized="True"/>
            <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationX)" Storyboard.TargetName="settingsButton">
                <EasingDoubleKeyFrame KeyTime="0" Value="30"/>
                <EasingDoubleKeyFrame KeyTime="0:0:1" Value="0">
                    <EasingDoubleKeyFrame.EasingFunction>
                        <ElasticEase EasingMode="EaseOut" Springiness="3"/>
                    </EasingDoubleKeyFrame.EasingFunction>
                </EasingDoubleKeyFrame>
            </DoubleAnimationUsingKeyFrames>
        </Storyboard>
    </phone:PhoneApplicationPage.Resources>
    
    
    <Grid>

        <!-- Create some columns on the page to organize our content -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <Grid.RowDefinitions>
            <RowDefinition Height="64" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>


        <Grid Grid.Row="0">

            <!-- Create some columns on the page to organize our content -->
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="64" />
                <ColumnDefinition Width="64" />
                <ColumnDefinition Width="64" />
                <ColumnDefinition Width="64" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="64" />
            </Grid.RowDefinitions>

            <TextBlock x:Name="fpsText"
                       Grid.Column="1"
                       Text="FPS"
                       Foreground="White"
                       TextAlignment="Center"
                       Visibility="Collapsed"/>

            <Rectangle x:Name="colorButton"
                   Grid.Column="2"
                   Margin="6" 
                   MouseLeftButtonDown="colorButton_MouseLeftButtonDown"
                   MouseEnter="button_MouseEnter"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}"
                       >
                <Rectangle.Projection>
                    <PlaneProjection/>
                </Rectangle.Projection>
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="Images/brush.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>

            <Rectangle x:Name="alarmsButton"
                   Grid.Column="3"
                   Margin="6" 
                   MouseLeftButtonDown="alarmsButton_MouseLeftButtonDown"
                   MouseEnter="button_MouseEnter"
                   MouseLeftButtonUp="button_MouseLeft"
                   MouseLeave="button_MouseLeft"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}" >
                <Rectangle.Projection>
                    <PlaneProjection/>
                </Rectangle.Projection>
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="Images/alarms.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>

            <Rectangle x:Name="settingsButton"
                   Grid.Column="4"
                   Margin="6" 
                   MouseLeftButtonDown="settingsButton_MouseLeftButtonDown"
                   MouseEnter="button_MouseEnter"
                   MouseLeftButtonUp="button_MouseLeft"
                   MouseLeave="button_MouseLeft"
                       Fill="{StaticResource PhoneContrastBackgroundBrush}">
                <Rectangle.Projection>
                    <PlaneProjection/>
                    </Rectangle.Projection>
                <Rectangle.OpacityMask>
                    <ImageBrush ImageSource="Images/settings.png"/>
                </Rectangle.OpacityMask>
            </Rectangle>

        </Grid>

        <Grid Grid.Row="1">

            <!-- Create some columns on the page to organize our content -->
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>

            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="*" />
            </Grid.RowDefinitions>


            <TextBlock x:Name="timeText" Text=""
                       FontSize="150"
                       Foreground="White" Margin="10,0,10,10" 
                       FontFamily="Lucida Sans Unicode"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Bottom" Height="179" />

            <TextBlock x:Name="dateText"
                       Grid.Row="1"
                       Text=""
                       FontSize="30"
                       Foreground="White" 
                       FontFamily="Lucida Sans Unicode"
                       HorizontalAlignment="Center"
                       VerticalAlignment="Top"/>

        </Grid>

        <ListBox x:Name="colorsList"
                 Background="{StaticResource PhoneContrastBackgroundBrush}"
                 Grid.Row="1"
                 Canvas.ZIndex="2"
                 Visibility="Collapsed"
                 VerticalAlignment="Top"
                 HorizontalAlignment="Right"
                 MinHeight="300"
                 MinWidth="240">
            
        </ListBox>
    </Grid>
    
    <!--Sample code showing usage of ApplicationBar-->
    <!--<phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button1.png" Text="Button 1"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar_button2.png" Text="Button 2"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="MenuItem 1"/>
                <shell:ApplicationBarMenuItem Text="MenuItem 2"/>
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>-->

</phone:PhoneApplicationPage>